const express = require('express');
const router = express.Router();
const formatJson = require('../utils/formatJson');

/* GET home page. */
router.get('/', function(req, res, next) {
	res.render('login');
});
router.post('/', function(req, res, next) {
	let obj = {
		username: req.body.username,
		password: req.body.password
	};
	console.log(obj);
	res.json(formatJson.success('登陆成功', obj));
});

module.exports = router;
